//
//  SimpleDB.m
//  cTypica
//
//  Created by David Kavanagh on 3/24/09.
//  Copyright 2009 directThought. All rights reserved.
//

#import "SimpleDB.h"
#import "ListDomainsDelegate.h"

@implementation SimpleDB
- (id)initWithAccessId:(NSString *)aId secretKey:(NSString *)sKey {
	self = [super initWithAccessId:accessId secretKey:secretKey hostName:@"sdb.amazonaws.com"];
	version = @"2007-11-07";
	return self;
}

- (id)initWithAccessId:(NSString *)aId secretKey:(NSString *)sKey hostName:(NSString *)hName {
	self = [super initWithAccessId:aId secretKey:sKey hostName:hName];
	version = @"2007-11-07";
	return self;
}

- (void)listDomains:(int)maxNumberOfDomains receiver:(id<DomainListProtocol>)receiver {
	NSMutableDictionary *params = [[NSMutableDictionary alloc] init];
	[params setValue:[NSString stringWithFormat:@"%d", maxNumberOfDomains] forKey:@"MaxNumberOfDomains"];
	ListDomainsDelegate *delegate = [ListDomainsDelegate delegateWithReceiver:receiver];
	[self makeRequest:@"ListDomains" parameters:params delegate:delegate];
	[params release];
	//[delegate release];
}
@end
